const { contextBridge, ipcRenderer, webFrame } = require("electron");

contextBridge.exposeInMainWorld("electron", {
  sendMessage: (channel, data) => {
      ipcRenderer.send(channel, data);
  },
  receiveMessage: (channel, func) => {
      ipcRenderer.on(channel, (event, ...args) => func(...args));
  },
  webFrame: {
    setZoomLevel: (level) => webFrame.setZoomLevel(level),
    setVisualZoomLevelLimits: (min, max) => webFrame.setVisualZoomLevelLimits(min, max)
  }
});
